package com.umgsai.thread.thread02;

public class MyThread3 extends Thread {
	private int i = 0;
	@Override
	public void run() {
		try {
			while (true) {
				i++;
				System.out.println("i=" + i);
				Thread.sleep(1000);
			}
		} catch (Exception e) {
			e.printStackTrace();
		}
	}
	
	public static void main(String[] args) {
		try {
			MyThread3 thread = new MyThread3();
			thread.setDaemon(true);
			thread.start();
			Thread.sleep(5000);
			System.out.println("exit");
		} catch (Exception e) {
			e.printStackTrace();
		}
	}
}
